home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / CAddPane < prev    next >
Text File  |  1995-08-23  |  2KB  |  61 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.CAddPane.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.03 (4th July 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern window_handle Pane2_CreateAndAddPane(char *windowname, int maxtitlesize,
  30.                                             window_handle mainwindow,
  31.                                             wimp_point *paneoffset,
  32.                                             wimp_point *panesize,
  33.                                             int flags)
  34. {
  35.  /*
  36.   * Creates pane window as Window_Create and adds to the main window
  37.   * 'mainwindow'.
  38.   * If 'paneoffset' is not NULL then this is taken as the offset between the
  39.   * pane and the main window instead of the positions in the template.
  40.   * If 'panesize' is not NULL then this is taken as the size of the pane
  41.   * instead of the size in the template.
  42.   * The window handle is returned or 0 if window cannot be created.
  43.   */
  44.   window_handle panewindow;
  45.  
  46.   panewindow = Window_Create(windowname, maxtitlesize);
  47.  
  48.   if(panewindow != 0){
  49.  
  50.      if(!Pane2_AddPane(mainwindow, panewindow, paneoffset, panesize, flags)){
  51.  
  52.         Window_Delete(panewindow);  /* delete panewindow if could not be added */
  53.         panewindow = 0;
  54.  
  55.      }
  56.  
  57.   }
  58.  
  59.   return(panewindow);
  60. }
  61.